﻿<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<title>登陆跳转</title>
<style type="text/css">
   @font-face {
    font-family: 'icomoon';
    src: url('fonts/icomoon.eot?1tb2pa');
    src: url('fonts/icomoon.eot?1tb2pa#iefix') format('embedded-opentype'),
        url('fonts/icomoon.ttf?1tb2pa') format('truetype'),
        url('fonts/icomoon.woff?1tb2pa') format('woff'),
        url('fonts/icomoon.svg?1tb2pa#icomoon') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

body {
       margin: 0;
    padding: 0;
    overflow: hidden;
    /* zoom: 85%; */
    position: absolute;
    width: 100%;
    height: 100%;
}

button {
    /* 去除按钮自带样式 */
    border: none !important;
    outline: none !important;
}


#container {
    /* 100%窗口高度 */
    height: 100vh;
}

.bg {
    /* 绝对定位 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sun {
    margin: 0;
    padding: 0;
    /* 绝对定位 水平垂直居中 */
    position: absolute;
    top: 500px;
    left: 48%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: orange;
    border-radius: 50%;
}

.moon {
    margin: 0;
    padding: 0;
    position: absolute;
    top: 54%;
    left: 48%;
    /* 计算得出月亮的位置 */
    transform: translate(calc(-50% + -160px), calc(-50% + -180px));
    width: 600px;
    height: 600px;
    /* 通过阴影绘制月亮 */
    box-shadow: 160px 180px 0 cyan;
    border-radius: 50%;
}

.sea {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 35%;
    /* 背景模糊制造大海的感觉 */
    backdrop-filter: blur(100px);
    -webkit-backdrop-filter: blur(100px);
    z-index: 100;
}

.sun,
.moon,
.sun-box,
.moon-box,
.bg {
    /* 添加动画过渡 */
    transition: all 1s ease-in-out;
}

.sun-box,
.moon-box {
    /* 相对定位 */
    position: relative;
    /* 溢出隐藏 */
    /* overflow: hidden; */
}

.light .bg {
}

/* 夜晚 */
.dark .sun-box {
    height: 0;
}

.dark .moon-box {
    height: 100%;
}

.dark .bg {

}
.bg-img{
    position: absolute;
    width: 100%;
    height: 100%;
}


/* ................................................. */
/* ....................按钮模块..................... */
/* ...... ..........................................*/

.container2 .c2 {
    /* 相对定位 */
    /* position: relative; */
    transition: 1s;
    z-index: 1;
    float: left;
    margin: 5px 0;
    cursor: pointer;
    position: relative;
    display: block;
    width: 80px;
    height: 40px;
    background-color: #222;
    border-radius: 40px;
    /* 内阴影 */
    box-shadow: inset 0 2px 15px rgba(0, 0, 0, 0.2),
        inset 0 2px 2px rgba(0, 0, 0, 0.2),
        inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}

/* 滑块 */
.container2 .indicator {
    /* 绝对定位 */
    position: absolute;
    z-index: 2;
    left: 0px;
    top: 5px;
    width: 40px;
    height: 40px;
    /* 渐变背景 */
    background: linear-gradient(to bottom, #444, #222);
    border-radius: 50%;
    /* 阴影 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    /* 缩小 */
    transform: scale(0.9);
    /* 动画过渡 */
    transition: 1s;
    /* 鼠标事件取消 */
    pointer-events: none;
}

/* 滑块中心发光点 */
.container2 .indicator::before {
    content: "";
    width: 5px;
    height: 5px;
    /* 绝对定位 居中 */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #f00;
    border-radius: 50%;
    /* 阴影制造发光效果 */
    box-shadow: 0 0 2px #f00,
        0 0 5px #f00,
        0 0 10px #f00,
        0 0 15px #f00,
        0 0 20px #f00,
        0 0 25px #f00,
        0 0 30px #f00,
        0 0 35px #f00;
    transition: 0.5s;
}

/* 勾选复选框后滑块的变化 */
.container2 input:checked~.indicator {
    left: 40px;
}

.container2 input:checked~.indicator::before {
    background-color: #0f0;
    box-shadow: 0 0 2px #0f0,
        0 0 5px #0f0,
        0 0 10px #0f0,
        0 0 15px #0f0,
        0 0 20px #0f0,
        0 0 25px #0f0,
        0 0 30px #0f0,
        0 0 35px #0f0;
}

.container2 input:checked~.dark .sun-box {
    height: 100% !important;
}

.container2 input:checked~.dark .sun {
    top: 62%;
}

.container2 input:checked~.dark .moon-box {
    height: 0 !important;
    transform-origin: -10px;
    transform: rotate(-90deg);
}

.container2 input:checked~.dark .bg {
    background: #ffeea2;
}

.container2 input:checked~label {
    background-color: #ffeea2;
}

.container2 input:checked~.indicator {
    background: #ffeea2;
    box-shadow: 0 0 .5;
}

/* ................................................. */
/* ....................登录模块...................... */
/* ...... ..........................................*/

.form-box {
    /* transform: scale(0.7, 0.7); */
    /* zoom: 90%; */
    position: absolute;
    top: 90px;
    /* left: 4%; */
    width: 80%;
    height: 326px;
    z-index: 101;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0px 20px 50px rgba(0, 0, 0, 0.5);
    padding: 0px 3%;
    margin-left: 6%;
}

.form-box .tit {
        cursor: default;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 10px;
    text-indent: 10px;
    margin: 20px auto 20px auto;
}

.form-box input {
    width: 100%;
    height: 35px;
    font-size: 17px;
    background: transparent;
    text-indent: 8px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    margin: 15px auto;
    outline: none;
    color: #fff;
}

.form-box input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.form-box button {
    font-size: 15px;
    width: 130px;
    height: 35px;
    /* margin: 10px auto 10px auto; */
    border: none;
    background: #00addd;
    color: #fff;
    letter-spacing: 3px;
    text-indent: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    max-height: 35px;
    overflow: hidden;
}

.form-box button:hover {
    transition: .5s;
    background: #0098d4;
    font-size: 17px;
}

.form-box span {
    font-size: 14px;
    color: #fff;
}

.form-box a {
    color: #00addd;
    text-decoration: none;
}

/* .............................................. */
/* ....................注册特效................... */
/* ...............................................*/
.search,
.close {
    font-family: 'icomoon';
    white-space: nowrap;
    font-style: normal;
    text-align: center;
}

.search:hover {
    text-decoration: underline;
}

.close {
    transition: .3s;
}

.close:hover {
    color: #f55858;
}

.search {
    font-size: 14px;
    color: #33b7eb;
}

/* 注册按钮 */
.search-btn {
    pointer-events: all;
    z-index: 301;
    font-style: normal;
    position: absolute;
    top: 79.2%;
    left: 59%;
    width: 50px;
    height: 50px;
    line-height: 60px;
    text-align: center;
    cursor: pointer;
}


/* 关闭按钮 */
.close-btn {
    background: none !important;
    pointer-events: all;
    position: absolute;
    top: -238px;
    right: -600px;
    z-index: 302;
    font-size: 25px;
    color: #fff;
    cursor: pointer;
    display: none;
}

.container3 {
    /* zoom: 80%; */
    z-index: 301;
    position: absolute;
    background: linear-gradient(200deg, #e7f0fd, #accbee);
    top: -97%;
    left: -180%;
    width: 2000px;
    height: 2000px;
    /* background-color: darkgrey; */
    /* 渐变背景 */
    /* background: linear-gradient(200deg, #6e86ee, #453c90); */
    /* 将元素剪切为一个圆形 【25px表示圆的半径】 【50% 50%表示圆心位置】 */
    clip-path: circle(40px at 50% 50%);
    /* clip-path: inset(975px 975px round 15px); */
    /* 设置过渡 */
    transition: .9s;
    opacity: 0;
}

.search-box {
    z-index: 303;
    /* 默认宽度为0（隐藏） */
    position: fixed;
    top: 0%;
    left: 0%;
    width: 0;
    height: 50px;
    border-bottom: 3px solid #fff;
    transition: 0.3s;
}

.search-box input {
    width: 100%;
    height: 50px;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 22px;
    font-weight: 500;
    /* 请输入前的缩进 */
    text-indent: 8px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box .fa {
    width: 50px;
    height: 50px;
    line-height: 50px;
    color: #fff;
    font-size: 22px;
    text-align: center;
    cursor: pointer;
}

#search_btn:checked~.search-btn {
    display: none;
}

#search_btn:checked~.container3 .shade {
    pointer-events: all;
    position: fixed;
    top: 28%;
    left: 36%;
    width: 400px;
    height: 550px;
    z-index: 120;
}

#search_btn:checked~.close-btn {
    display: block;
}

#search_btn:checked~.container3 {
    opacity: 1;
    clip-path: circle(100%);
}

#search_btn:checked~.container3 .search-box {
    width: 400px;
}


.s1 {
    pointer-events: all;
    position: fixed;
    float: left;
    top: 45%;
    left: 36%;
}

.s2 {
    top: 52%;
}

.s3 {
    width: 250px !important;
    top: 59%;
}

.s3 button {
    position: fixed;
    pointer-events: all !important;
    font-style: normal;
    top: 56.5%;
    left: 51%;
    font-size: 15px;
    width: 130px;
    height: 45px;
    margin: 35px auto 40px auto;
    border: none;
    background-color: #d5e4f6;
    color: #71c9eb;
    /* letter-spacing: 20px;
    text-indent: 20px; */
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: .5s;
}

.s3 .verification-code:hover {
    background-color: #5abce6;
    color: #d5e4f6;
}


/* 流星特效 */

.container4 span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background-color: #fff;
    border-radius: 50%;
    /* 发光效果 */
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1),
        0 0 0 8px rgba(255, 255, 255, 0.1),
        0 0 20px rgba(255, 255, 255, 1);
    /* 执行动画 */
    animation: animate 3s linear infinite;
}

/* 拖尾效果 */
.container4 span::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 3px;
    background: linear-gradient(90deg, #fff, transparent);
}

/* 分别为每一个流星设置位置、动画延迟时间、动画时长 */
.container4 span:nth-child(1) {
    top: 0;
    right: 0;
    /* initial关键字用于设置CSS属性为它的默认值 */
    /* 这个东西可以用来强制覆盖前面设置的属性 */
    /* left的初始值为auto，所以就相当于left:auto */
    left: initial;
    /* 动画延迟时间 */
    animation-delay: 0s;
    /* 动画时长 */
    animation-duration: 1s;
}

.container4 span:nth-child(2) {
    top: 0;
    right: 80px;
    left: initial;
    animation-delay: 0.2s;
    animation-duration: 3s;
}

.container4 span:nth-child(3) {
    top: 80px;
    right: 0;
    left: initial;
    animation-delay: 0.4s;
    animation-duration: 2s;
}

.container4 span:nth-child(4) {
    top: 0;
    right: 180px;
    left: initial;
    animation-delay: 0.6s;
    animation-duration: 1.5s;
}

.container4 span:nth-child(5) {
    top: 0;
    right: 400px;
    left: initial;
    animation-delay: 0.8s;
    animation-duration: 2.5s;
}

.container4 span:nth-child(6) {
    top: 0;
    right: 600px;
    left: initial;
    animation-delay: 1s;
    animation-duration: 3s;
}

.container4 span:nth-child(7) {
    top: 300px;
    right: 0;
    left: initial;
    animation-delay: 1.2s;
    animation-duration: 1.75s;
}

.container4 span:nth-child(8) {
    top: 0;
    right: 700px;
    left: initial;
    animation-delay: 1.4s;
    animation-duration: 1.25s;
}

.container4 span:nth-child(9) {
    top: 0;
    right: 1000px;
    left: initial;
    animation-delay: 0.75s;
    animation-duration: 2.25s;
}

.container4 span:nth-child(10) {
    top: 0;
    right: 450px;
    left: initial;
    animation-delay: 2.75s;
    animation-duration: 2.25s;
}

/* 流星坠落动画 */
@keyframes animate {
    0% {
        transform: rotate(315deg) translateX(0);
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: rotate(315deg) translateX(-1000px);
        opacity: 0;
    }
}

.check-box{
  text-align: right;
    width: 100%;
}
.check-auto{
        /* font-size: 30px !important; */
    width: 20px !important;
    height: 20px !important;
    margin: 0px !important;
    margin-left: 91px !important;
}
.check-text{
    float: right;
    top: 7px;
    display: inline-block;
    margin-top: 1px;
    margin-left: 10px;
}
.version-box{
    position: absolute;
    bottom: 12px;
    text-align: center;
    width: 100%;
    color: #fff;
    font-size: 13px;
}
    </style>
</head>

<body class="container2">
<!-- 按钮模块 -->
<!--<input type="checkbox" id="a12" hidden>
<i class="indicator"></i>
<label class="c2" for="a12"></label>-->
<!-- 日月交替模块 -->
<div id="container" class="dark">
    <div class="bg"></div>
    <img class="bg-img" src="bg.png">
   <!-- <div class="moon-box">
        <div class="moon"></div>
    </div>
    <div class="sun-box">
        <div class="sun"></div>
    </div>
    <div class="sea"></div>-->
</div>
<!-- 登录模块 -->
<div class="form-box">
    <div class="tit">连接服务器</div>
    <input type="text" placeholder="服务器IP:如 192.168.0.1" id="ip">
    <input type="text" placeholder="端口，如:9527"  id="port">

    <div class="check-box">
        <input type="checkbox" class="check-auto" id="checkboxAuto">
        <span  class="check-text">自动进入</span>
    </div>

    <div class="btn-box">
        <button onclick="goIn();" id="btnGo">进入</button>
        <button onclick="goCancel();" id="btnCancel" style="display: none">取消</button>
    </div>

</div>

<div class="version-box">
    版本: 2023-11-09-001
</div>
</body>

</html>
<script type="text/javascript">
    var inputIp = window.document.getElementById("ip");
    var inputPort = window.document.getElementById("port");
    var checkboxAuto = window.document.getElementById("checkboxAuto");
    var btnGo = window.document.getElementById("btnGo");
    var btnCancel = window.document.getElementById("btnCancel");
    var storageKeyPre = 'system_auto_in_'
    var autoIn = false
    var nTimes = 4

    // 初始化方法
    function init() {
        if (window.localStorage) {
            var ip = window.localStorage.getItem(storageKeyPre + "ip");
            var port = window.localStorage.getItem(storageKeyPre + "port");
            var checkboxAutoValue = window.localStorage.getItem(storageKeyPre + "checkboxAuto");
            if (!ip) {
                ip = '';
            }
            if (!port) {
                port = '9522';
            }

            if ([true,'true', 1, '1'].includes(checkboxAutoValue)) {
                checkboxAutoValue = true
            } else {
                checkboxAutoValue = false
            }

            inputIp.value = ip
            inputPort.value = port
            console.log('checkboxAutoValue'), checkboxAutoValue
            checkboxAuto.checked = checkboxAutoValue
            inputIp.focus();
            if (checkboxAutoValue == true) {
                autoIn = true
                btnGo.innerHTML = "自动进入中";
                btnCancel.style.display = "inline-block";
                playMsg();
                setTimeout(function () {
                    if (autoIn) {
                        goIn();
                    }
                }, 5000)
            }
        }
    }

    // 保存到缓存里面
    function saveStorage() {
        if (!window.localStorage) {
            alert('当前不支持本地存储')
            return
        }
        window.localStorage.setItem(storageKeyPre + "ip", inputIp.value);
        window.localStorage.setItem(storageKeyPre + "port", inputPort.value);
        window.localStorage.setItem(storageKeyPre + "checkboxAuto", checkboxAuto.checked);
    }

    // 进入方法
    function goIn() {
        try{
            navigator.vibrate = navigator.vibrate ||
                navigator.webkitVibrate ||
                navigator.mozVibrate ||
                navigator.msVibrate
            if(navigator.vibrate) {
                navigator.vibrate(100);
            }
        }catch(e) {}
        if (inputIp.value.length <= 10) {
            inputIp.focus();
            return false;
        }
        if (inputPort.value.length <= 3){
            inputPort.focus();
            return false;
        }
        saveStorage();
        var toUrl = 'http://' + inputIp.value + ':' + inputPort.value;
        window.location.href = toUrl;
    }

    // 取消
    function goCancel() {
        btnGo.innerHTML = "进入";
        autoIn = false
        btnCancel.style.display = "none";
    }

    // 提示音
    function playMsg() {
        if (window.callAndroid) {
            window.callAndroid.playMsg()
        }
    }

    // 安卓回调函数
    function androidCallJS(para) {
        alert('androidCallJS')
    }

    //android 返回键 返回true：则执行物理按键返回功能
    window.androidBack = function (){
      if (confirm("是否退出系统") == true) {
          window.callAndroid.androidBack()
      }
      return false
    }

    init();
</script>